package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) FileList(ctx context.Context, req *system.FileListReq) (res *system.FileListRes, err error) {
	res = new(system.FileListRes)
	res.List, res.Total, err = service.File().GetAttachmentList(ctx, model.FileListInput{
		FileCategoryIds: req.FileCategoryIds,
		OriginalName:    req.OriginalName,
		Page:            req.Page,
		PageSize:        req.PageSize,
	})
	return
}
